<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
						<div class="form-group">
							<div class="columns pull-left">
								<button shiro:hasPermission="biz:works:add" type="button" class="btn  btn-primary" onclick="add()">
									<i class="fa fa-plus" aria-hidden="true"></i>添加
								</button>
								<button shiro:hasPermission="biz:works:batchRemove" type="button" class="btn  btn-danger"
									onclick="batchRemove()">
									<i class="fa fa-trash" aria-hidden="true"></i>删除
								</button>
								<button id="imports" shiro:hasPermission="biz:works:import" type="button" class="btn  btn-primary">
									<i class="fa fa-mail-reply" aria-hidden="true"></i>导入
								</button>
								<button shiro:hasPermission="biz:works:export" type="button" class="btn  btn-primary"
										onclick="exports()">
									<i class="fa fa-mail-forward" aria-hidden="true"></i>导出
								</button>
							</div>
							<div class="columns pull-left" style="width:5px">
								<label></label>
							</div>

						</div>
						<div class="form-group col-sm-12">
							<div class="columns pull-left col-sm-12">
								<label class="col-sm-12 control-label">  </label>
							</div>
						</div>
						<div class="form-group col-sm-15">
							<form id="searchForm" name="searchForm">
								<!--
                            <div class="columns pull-left col-md-1 nopadding">
                                <input id="submitDate" name="submitDate" style="width:88%;" type="text" class="form-control"  onchange="reLoad()"
                                       placeholder="提交日期">
                            </div>-->
								<div class="input-group date columns pull-left col-md-2 nopadding"  id='date1'>
									<input id="submitDate" name="submitDate" placeholder="提交日期" style="width:100%;" type="text" class="form-control">
									<span class="input-group-addon">
											<i class="glyphicon glyphicon-calendar"></i>
										</span>
								</div>
								<div class="columns pull-left" style="width:5px">
									<label></label>
								</div>
								<div class="input-group date columns pull-left col-md-2 nopadding"  id='date2'>
									<input id="approvalDate" name="approvalDate" placeholder="出证日期" style="width:100%;" type="text" class="form-control">
									<span class="input-group-addon">
											<i class="glyphicon glyphicon-calendar"></i>
										</span>
								</div>
								<div class="columns pull-left" style="width:5px">
									<label></label>
								</div>
								<div class="columns pull-left col-md-2 nopadding">
									<input id="agentCompany" name="agentCompany" style="width:88%;" type="text" class="form-control"  onchange="reLoad()"
										   placeholder="代理公司">
								</div>

								<div class="columns pull-left col-md-2 nopadding">
									<select id="status" name="status" class="selectpicker" style="width:88%;height:33px" onchange="reLoad()">
										<option value="" selected>状态</option>
										<option value="" >所有</option>
										<option value="0">未提交</option>
										<option value="1">提交</option>
										<option value="2">未发证</option>
										<option value="3">已发证</option>
									</select>
								</div>
								<div class="columns pull-left" style="width:5px">
									<label></label>
								</div>
								<div class="columns pull-left col-md-2 nopadding">
									<input id="sn" name="sn" type="text" style="width:100%;" class="form-control"  onchange="reLoad()"
										   placeholder="流水号">
								</div>
								<div class="columns pull-right col-md-1 nopadding">
									<button shiro:hasPermission="biz:software:edit" type="button" class="btn btn-primary"
											onclick="resetVal()">
										<i class="fa fa-refresh" aria-hidden="true"></i>重置
									</button>
								</div>

							</form>
						</div>
					<div class="form-group col-sm-12">
						<div class="columns pull-left col-sm-12">
							<label class="col-sm-12 control-label">  </label>
						</div>
					</div>
					<table id="exampleTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>
	</div>
	<!--shiro控制bootstraptable行内按钮看见性 -->
		<div>
			<script type="text/javascript">
				var s_edit_h = 'hidden';
				var s_remove_h = 'hidden';
				var s_resetPwd_h = 'hidden';
			</script>
		</div>
		<div shiro:hasPermission="biz:works:edit">
			<script type="text/javascript">
				s_edit_h = '';
			</script>
		</div>
		<div shiro:hasPermission="biz:works:remove">
			<script type="text/javascript">
				var s_remove_h = '';
			</script>
		</div>
		<div shiro:hasPermission="biz:works:resetPwd">
			<script type="text/javascript">
				var s_resetPwd_h = '';
			</script>
		</div>
	</div>
	<div th:include="include :: footer"></div>
	<script type="text/javascript" src="/js/appjs/biz/works/works.js"></script>
	<script src="/js/layui.js"></script>
	<script type="text/javascript">
		layui.use('upload', function () {
			var upload = layui.upload;
			//执行实例
			var uploadInst = upload.render({
				elem: '#imports', //绑定元素
				url: '/biz/works/upload', //上传接口
				size: 1000,
				accept: 'file',
				done: function (r) {
					layer.msg(r.msg);
					reLoad();
				},
				error: function (r) {
					layer.msg(r.msg);
				}
			});
		});
	</script>
	<script>
		$(function () {
			$('#date1').datetimepicker({
				format: 'YYYY-MM-DD',
				locale: moment.locale('zh-cn'),

			}).on('focusout',function chDate() {
				reLoad();

			})
		});
	</script>
	<script>
		$(function () {
			$('#date2').datetimepicker({
				format: 'YYYY-MM-DD',
				locale: moment.locale('zh-cn'),

			}).on('focusout',function chDate(){
				reLoad();
			})
		});
	</script>
	<script>
		function resetVal() {
			document.getElementById("searchForm").reset();
			reLoad();

		}
	</script>
</body>
</html>
